{% extends 'mote.html' %}
{% block asset %}
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">

        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">修改物资</h3>
            </div>
            <div class="panel-body">
                <form class="form-horizontal" action="" method="post">
                    {% csrf_token %}
                        <div class="form-group {% if error %}has-error{% endif %} ">

                            <label for="inputEmail3" class="col-sm-2 col-sm-offset-1 control-label">物资名称</label>
                            <div class="col-sm-6">
                                <input type="text" name="name" class="form-control" id="inputEmail3"
                                       value="{{ asset_dan.name }}">

                                <span class="help-block">{{ error }} </span>
                            </div>
                        </div>
                <div class="form-group {% if error %}has-error{% endif %} ">

                            <label for="inputEmail3" class="col-sm-2 col-sm-offset-1 control-label">物资描述</label>
                            <div class="col-sm-6">
                                <input type="text" name="describe" class="form-control" id="inputEmail3"
                                       value="{{ asset_dan.describe }}">

                                <span class="help-block">{{ error }} </span>
                            </div>
                        </div>
                     <div class="form-group {% if error %}has-error{% endif %} ">

                            <label for="inputEmail3" class="col-sm-2 col-sm-offset-1 control-label">物资编号</label>
                            <div class="col-sm-6">
                                <input type="text" name="num" class="form-control" id="inputEmail3"
                                       value="{{ asset_dan.num }}">

                                <span class="help-block">{{ error }} </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputPassword3" class="col-sm-2 col-sm-offset-1 control-label">购买人</label>
                            <div class="col-sm-6">
                                <select multiple class="form-control form-group" name="people" id="">
                                    {% for foo in people_all %}
                                        {% if foo in asset_dan.people.all %}
                                            <option selected value="{{ foo.pk }}">{{ foo.user }}</option>
                                        {% else %}
                                            <option value="{{ foo.pk }}">{{ foo.user }}</option>
                                            {##}
                                        {% endif %}

                                    {% endfor %}

                                </select>

                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-10">
                                <button style="margin-left: 30%" class="btn btn-default">保存</button>

                            </div>
                        </div>

                    </form>
      </div>
            </div>

        </div>

{% endblock %}
{% block k1 %}
    class="active"
{% endblock %}
{% block margin %}
    <style>
    .col-md-offset-2 {
        margin-left: 0;
    }
    </style>
{% endblock %}